home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / lout.vim < prev    next >
Encoding:
Text File  |  2001-09-12  |  4.3 KB  |  137 lines

  1. " Vim syntax file
  2. " Language   : Lout
  3. " Maintainer : Christian V. J. Brüssow <cvjb@epost.de>
  4. " Last change: Son 06 Mai 2001 20:33:13 CEST
  5.  
  6. " Lout: Basser Lout document formatting system.
  7.  
  8. " For version 5.x: Clear all syntax items
  9. " For version 6.x: Quit when a syntax file was already loaded
  10. if version < 600
  11.     syntax clear
  12. elseif exists("b:current_syntax")
  13.     finish
  14. endif
  15.  
  16. " Lout is case sensitive
  17. syn case match
  18.  
  19. " Synchronization, I know it is a huge number, but normal texts can be
  20. " _very_ long ;-)
  21. syn sync lines=1000
  22.  
  23. " Characters allowed in keywords
  24. " I don't know if 128-255 are allowed in ANS-FORHT
  25. if version >= 600
  26.     setlocal iskeyword=@,48-57,.,@-@,_,192-255
  27. else
  28.     set iskeyword=@,48-57,.,@-@,_,192-255
  29. endif
  30.  
  31. " Some special keywords
  32. syn keyword loutTodo contained TODO lout Lout LOUT
  33. syn keyword loutDefine def macro
  34.  
  35. " Some big structures
  36. syn keyword loutKeyword @Begin @End @Figure @Tab
  37. syn keyword loutKeyword @Book @Doc @Document @Report
  38. syn keyword loutKeyword @Introduction @Abstract @Appendix
  39. syn keyword loutKeyword @Chapter @Section @BeginSections @EndSections
  40.  
  41. " All kind of Lout keywords
  42. syn match loutFunction '\<@[^ \t{}]\+\>'
  43.  
  44. " Braces -- Don`t edit these lines!
  45. syn match loutMBraces '[{}]'
  46. syn match loutIBraces '[{}]'
  47. syn match loutBBrace '[{}]'
  48. syn match loutBIBraces '[{}]'
  49. syn match loutHeads '[{}]'
  50.  
  51. " Unmatched braces.
  52. syn match loutBraceError '}'
  53.  
  54. " End of multi-line definitions, like @Document, @Report and @Book.
  55. syn match loutEOmlDef '^//$'
  56.  
  57. " Grouping of parameters and objects.
  58. syn region loutObject transparent matchgroup=Delimiter start='{' matchgroup=Delimiter end='}' contains=ALLBUT,loutBraceError
  59.  
  60. " The NULL object has a special meaning
  61. syn keyword loutNULL {}
  62.  
  63. " Comments
  64. syn region loutComment start='\#' end='$' contains=loutTodo
  65.  
  66. " Double quotes
  67. syn region loutSpecial start=+"+ skip=+\\\\\|\\"+ end=+"+
  68.  
  69. " ISO-LATIN-1 characters created with @Char, or Adobe symbols
  70. " created with @Sym
  71. syn match loutSymbols '@\(\(Char\)\|\(Sym\)\)\s\+[A-Za-z]\+'
  72.  
  73. " Include files
  74. syn match loutInclude '@IncludeGraphic\s\+\k\+'
  75. syn region loutInclude start='@\(\(SysInclude\)\|\(IncludeGraphic\)\|\(Include\)\)\s*{' end='}'
  76.  
  77. " Tags
  78. syn match loutTag '@\(\(Tag\)\|\(PageMark\)\|\(PageOf\)\|\(NumberOf\)\)\s\+\k\+'
  79. syn region loutTag start='@Tag\s*{' end='}'
  80.  
  81. " Equations
  82. syn match loutMath '@Eq\s\+\k\+'
  83. syn region loutMath matchgroup=loutMBraces start='@Eq\s*{' matchgroup=loutMBraces end='}' contains=ALLBUT,loutBraceError
  84. "
  85. " Fonts
  86. syn match loutItalic '@I\s\+\k\+'
  87. syn region loutItalic matchgroup=loutIBraces start='@I\s*{' matchgroup=loutIBraces end='}' contains=ALLBUT,loutBraceError
  88. syn match loutBold '@B\s\+\k\+'
  89. syn region loutBold matchgroup=loutBBraces start='@B\s*{' matchgroup=loutBBraces end='}' contains=ALLBUT,loutBraceError
  90. syn match loutBoldItalic '@BI\s\+\k\+'
  91. syn region loutBoldItalic matchgroup=loutBIBraces start='@BI\s*{' matchgroup=loutBIBraces end='}' contains=ALLBUT,loutBraceError
  92. syn region loutHeadings matchgroup=loutHeads start='@\(\(Title\)\|\(Caption\)\)\s*{' matchgroup=loutHeads end='}' contains=ALLBUT,loutBraceError
  93.  
  94. " Define the default highlighting.
  95. " For version 5.7 and earlier: only when not done already
  96. " For version 5.8 and later: only when an item doesn't have highlighting yet
  97. if version >= 508 || !exists("did_lout_syn_inits")
  98.     if version < 508
  99.         let did_lout_syn_inits = 1
  100.         command -nargs=+ HiLink hi link <args>
  101.     else
  102.         command -nargs=+ HiLink hi def link <args>
  103.     endif
  104.  
  105.     " The default methods for highlighting. Can be overrriden later.
  106.     HiLink loutTodo Todo
  107.     HiLink loutDefine Define
  108.     HiLink loutEOmlDef Define
  109.     HiLink loutFunction Function
  110.     HiLink loutBraceError Error
  111.     HiLink loutNULL Special
  112.     HiLink loutComment Comment
  113.     HiLink loutSpecial Special
  114.     HiLink loutSymbols Character
  115.     HiLink loutInclude Include
  116.     HiLink loutKeyword Keyword
  117.     HiLink loutTag Tag
  118.     HiLink loutMath Number
  119.  
  120.     " HiLink Not really needed here, but I think it is more consistent.
  121.     HiLink loutMBraces loutMath
  122.     hi loutItalic term=italic cterm=italic gui=italic
  123.     HiLink loutIBraces loutItalic
  124.     hi loutBold term=bold cterm=bold gui=bold
  125.     HiLink loutBBraces loutBold
  126.     hi loutBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
  127.     HiLink loutBIBraces loutBoldItalic
  128.     hi loutHeadings term=bold cterm=bold guifg=indianred
  129.     HiLink loutHeads loutHeadings
  130.  
  131.     delcommand HiLink
  132. endif
  133.  
  134. let b:current_syntax = "lout"
  135.  
  136. " vim:ts=3:sw=3:
  137.